package com.itheima.exer.exercise.ex0928.test;

import com.itheima.exer.exercise.ex0928.doman.Student;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class SetDemo1 {
    public static void main(String[] args) {
        Set<Student> ss = new TreeSet<>();
        ss.add(new Student("张三",18,98));
        ss.add(new Student("李四",20,80));
        ss.add(new Student("王五",18,98));
        ss.add(new Student("马六",20,60));
        ss.add(new Student("田七",16,71));
        Iterator<Student> iterator = ss.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
